import http from '@/urilts/http'

//查看请求
export function CheckReq() {
  return http({
    url: '/posts',
    method: 'get'
  })
}
//删除请求

export function DelReq(id) {
  return http({
    url: `/posts/${id}`,
    method: 'delete'
  })
}

//编辑请求

export function EditReq(id, title, content, status) {
  return http({
    method: 'put',
    url: `/posts/${id}`,
    data: {
      title,
      content,
      status
    }
  })
}

export function AddReq(title, content, status) {
  return http({
    method: 'post',
    url: '/posts',
    data: {
      title,
      content,
      status
    }
  })
}
